import RPi.GPIO as GPIO
import time
from adafruit_servokit import ServoKit

class actions:
    
    def __init__(self):
        self.kit = ServoKit(channels=16)
        


    def pickUp(self):
        
        self.kit.servo[1].angle = 150
        time.sleep(1)
        self.kit.servo[2].angle = 110
        time.sleep(1)
        self.kit.servo[3].angle = 50
        time.sleep(1)
        self.kit.servo[15].angle = 10
        time.sleep(1)
        self.kit.servo[2].angle = 100
        time.sleep(1)
        self.kit.servo[2].angle = 90
        time.sleep(1)
        self.kit.servo[2].angle = 70
        time.sleep(1)
        self.kit.servo[15].angle = 90
        time.sleep(1)
        self.kit.servo[3].angle = 80
        time.sleep(1)
        self.kit.servo[3].angle = 100
        time.sleep(1)
        self.kit.servo[2].angle = 100
        time.sleep(1)
        self.kit.servo[1].angle = 130
        time.sleep(1)
        self.kit.servo[1].angle = 90
   
    def release(self):
        self.kit.servo[15].angle = 30
        time.sleep(1)
    
    def headDown(self):
        
        self.kit.servo[7].angle = 20
        time.sleep(0.5)
        self.kit.servo[7].angle = 50
        time.sleep(0.5)
        self.kit.servo[7].angle = 20
        time.sleep(0.5)
        self.kit.servo[7].angle = 50
        
        
    def turnLeft(self):
        self.kit.servo[8].angle = 95
        
    def turnRight(self):
        self.kit.servo[8].angle = 178
        
        